package cn.wolfcode.trip.admin.controller;

import cn.wolfcode.trip.base.query.QueryObject;
import cn.wolfcode.trip.base.service.IInsuranceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("insurance")
public class InsuranceControlller {
    @Autowired
    private IInsuranceService insuranceService;
    @RequestMapping("list")
    public String list(Model model, @ModelAttribute("qo") QueryObject qo) {
        //按照推荐时间倒序排列
        qo.setOrderBy("buyTime desc");
        model.addAttribute("result", insuranceService.queryForList(qo));
        return "insurance/list";
    }



}
